<%--
  Created by IntelliJ IDEA.
  User: ggj
  Date: 2016/12/6
  Time: 9:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <base href="<%=basePath%>" />
    <title>登录</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
    <style>
        body {font-family:"Microsoft YaHei UI";}
    </style>
</head>
<body>
<div class="container">
    <div style="margin:150px auto;width:600px;">
        <div class="form-group">
            <h2 style="text-align:center;">营业厅用户登录</h2>
        </div>
        <div class="form-group">
            <input id="username" type="text" class="form-control input-lg" placeholder="请输入用户名">
        </div>
        <div class="form-group">
            <input id="password" type="password" class="form-control input-lg" placeholder="请输入密码">
        </div>
        <div class="form-group">
            <button class="btn btn btn-success btn-lg btn-block" onclick="login()">登录</button>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
    function login() {
        var username = $("#username").val();
        var password = $("#password").val();
        if(username==null||username==""){
            alert("请输入用户名");
            return;
        }else if(password==null||password==""){
            alert("请输入密码");
            return;
        }
        $.post("<%=path%>/authSysuser", {
            username : username,
            password : password
        }, function (data) {
            if(data) {
                window.location.href="<%=path%>/login1";
            } else {
                alert("用户名或密码错误");
            }
        });
    }
</script>
</html>
